﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="JavascriptGame.aspx.cs" Inherits="JavascriptGame" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script src="script/jquery-1.6.2.js" type="text/javascript"></script>
    <style type="text/css">
        <%--div{}--%>
        .cell{width:40px;height:40px;display:inline;}
        .selected{border:1px solid blue;}
        img{border:1px solid black;}
        
    </style>
    <script type="text/javascript">
        var singleton = function () {
            //
            var width = 2;
            var height = 2;
            var nSelected = 0;

            return {
                //初始化
                initGame: function () {

                },
                addSelect: function () {
                    nSelected++;
                },
                getSelectedCount: function () {
                    return height;
                }

            }

        } ();

        
    </script>
</head>
<body>
    <form id="form1" runat="server">
        <div>
            <div class="cell" >
                <img src="img/xiong.jpg" />
            </div>
            <div class="cell">
                <img src="img/xiong.jpg" />
            </div>
        </div>
        <%--<div style="width:80px;height:40px">
            <div class="cell">
                <img src="img/xiong.jpg" />
            </div>
            <div class="cell">
                <img src="img/xiong.jpg" />
            </div>
        </div>--%>
    </form>
</body>
</html>
<script type="text/javascript">
    $(function () {
        $("div.cell").mousedown(function () {
            $("div").removeClass("selected")
            $(this).addClass("selected");
        });
    });
</script>
